package edu.bath.sensorframework.triplestore.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("TripeStoreAgentService")
public interface TripeStoreAgentService extends RemoteService {
	public String getAgraphUsername();
	public String getAgraphServerURL();
	public boolean hasAgraphPassword();
	public String getAgraphCatID();
	public String getAgraphRepoID();
	
	public void setAgraphPassword(String password);
	public void setAgraphRepoID(String repoID);
	public void setAgraphCatID(String catID);
	public void setAgraphUsername(String username);
	public void setAgraphServerURL(String serverURL);
	// atomic forms
	public void updateSettings(String serverURL, String username, String password, String catID, String repoID);
	public void updateSettings(String serverURL, String username, String catID, String repoID);
	
	// add data source
	public void addDataSource(String handle) throws RuntimeException;
	
	/**
	 * Utility class for simplifying access to the instance of async service.
	 */
	public static class Util {
		private static TripeStoreAgentServiceAsync instance;
		public static TripeStoreAgentServiceAsync getInstance(){
			if (instance == null) {
				instance = GWT.create(TripeStoreAgentService.class);
			}
			return instance;
		}
	}
}
